package com.hengpeng.itfinbase.persist;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.hengpeng.common.web.annotation.HtmlInput;
import com.hengpeng.common.web.annotation.HtmlInputType;
import com.hengpeng.itfinbase.idAssign.AbstractAssign19IdEntity;

/**
 * 系统日志
 * 
 * @author weiyuan
 *
 */
@Entity
@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
public class SystemLog extends AbstractAssign19IdEntity {
    private static final long serialVersionUID = -7826793643331530256L;

    /**
     * <pre>
     * 日志类型
     * </pre>
     */
    public enum LogType {
        INVEST_DO("投标处理动作"),

        INVEST_EXCEPTION("投标异常"),

        INVEST_MESSAGE("投标处理通知消息"),

        LOAN_DO("放款处理动作"),

        LOAN_EXCEPTION("放款异常"),

        LOAN_MESSAGE("放款处理通知信息"),

        REPAYMENT_DO("还款处理动作"),

        REPAYMENT_MESSAGE("还款处理通知信息"),

        REPAYMENT_EXCEPTION("还款异常"),

        ACTIVITYSET_EXCEPTION("活动异常"),

        ACTIVITYSET_DO("活动处理动作"),

        ACTIVITYSET_MESSAGE("活动处理通知消息"),

        SYSTEMERROR("系统严重错误");

        private String text;

        LogType(String text) {
            this.text = text;
        }

        public String getText() {
            return text;
        }

        public void setText(String text) {
            this.text = text;
        }
    }

    /**
     * 操作类型
     */
    @Column(length = 50)
    @Enumerated(javax.persistence.EnumType.STRING)
    @HtmlInput(label = "操作类型", type = HtmlInputType.SELECT, labelProperty = "text", index = 15, nullable = false)
    private LogType type;
    /**
     * 标的id
     */
    @Column(length = 50)
    @HtmlInput(index = 3, type = HtmlInputType.TEXT, label = "借款标的id", nullable = true)
    private String borrowInfoId;

    /**
     * 订单号,投标中对应投标订单号，放款中对应投标订单号，放款中对应放款订单号
     */
    @Column(length = 50)
    @HtmlInput(index = 3, type = HtmlInputType.TEXT, label = "订单号", nullable = true)
    private String orderId;

    /**
     * 日志内容
     */
    @Column(length = 4000)
    @HtmlInput(index = 4, type = HtmlInputType.TEXT, label = "原始内容", nullable = true)
    private String content;

    /**
     * 创建日期
     */
    @HtmlInput(index = 5, type = HtmlInputType.TEXT, label = "创建日期", nullable = true)
    private Date createTime;
    /**
     * 更新日期
     */
    @HtmlInput(index = 5, type = HtmlInputType.TEXT, label = "更新日期", nullable = true)
    private Date updateTime;

    public LogType getType() {
        return type;
    }

    public void setType(LogType type) {
        this.type = type;
    }

    public String getOrderId() {
        return orderId;
    }

    public String getBorrowInfoId() {
        return borrowInfoId;
    }

    public void setBorrowInfoId(String borrowInfoId) {
        this.borrowInfoId = borrowInfoId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

}